package com.caifeng.contentproviderwork;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class PersonSQLiteOpenHelper extends SQLiteOpenHelper {
    /**
     * 创建数据库  person
     * @param context
     */
    public PersonSQLiteOpenHelper(Context context) {
        super(context, "person.db", null, 1);
    }

    /**
     * 创建表 info
     * @param db
     */
    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table info (_id integer primary key autoincrement, name varchar(20))");

    }

    /**
     *数据库升级时用
     * @param db
     * @param oldVersion
     * @param newVersion
     */
    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
